package com.gitee.faster.webdav.kernel.model;

import jakarta.xml.bind.annotation.*;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author hongda.li
 */
@Data
@Accessors(chain = true)
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
        "any"
})
@XmlRootElement(name = "error")
public class Error {

    @XmlAnyElement(lax = true)
    private Object any;

    public Error setException(Exception e) {
        this.any = Message.of(e.getMessage());
        return this;
    }
}
